package com.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class AspectXML {

    public void myBefore(JoinPoint joinPoint) {
        System.out.println("****前置通知myBefore****切入的方法" +joinPoint.getTarget() );
        System.out.println("myBefore目标类====" + joinPoint.getSignature().getName());
    }

    public void myAfterReturning(JoinPoint joinPoint) {
        System.out.println("****后置返回通知myAfterReturning****切入的方法" +joinPoint.getTarget() );
        System.out.println("myAfterReturning目标类====" + joinPoint.getSignature().getName());
    }

    public Object myAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("环绕开始******");
        Object obj = proceedingJoinPoint.proceed();
        System.out.println("环绕结束******");
        return obj;
    }

    public void myException(JoinPoint joinPoint ,Throwable e) {
        System.out.println("异常通知***** 出错-->" + e.getMessage());
    }

    public void myFinal() {
        System.out.println("最终通知==========");
    }
}
